import request from '@/utils/request'

export function getRoleList(roleName, status, index, size) {
	return request({
		url: '/admin/managerRole/getRoleList',
		method: 'post',
		data: {
			roleName,
			status,
			index,
			size
		}
	})
}

export function addRole(roleName, remark, permissions) {
	return request({
		url: '/admin/managerRole/addRole',
		method: 'post',
		data: {
			roleName,
			remark,
			permissions
		}
	})
}

export function getRoleInfo(roleId) {
	return request({
		url: '/admin/managerRole/getRoleInfo',
		method: 'post',
		data: {
			roleId,
		}
	})
}

export function updateRole(roleId, roleName, remark, permissions, status) {
	return request({
		url: '/admin/managerRole/updateRole',
		method: 'post',
		data: {
			roleId,
			roleName,
			remark,
			permissions,
			status
		}
	})
}

export function deleteRole(roleId){
	return request({
		url:'/admin/managerRole/deleteRole',
		method:'post',
		data:{
			roleId,
			status:2
		}
	})
}
